<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>		  
		<div id="app"> 
		    <h3>v-bind动态绑定属性</h3>
			
			
			<img v-bind:src="imageArr[index]">
			
			<p></p>
			
			<img :src="imageArr[index]">
			
		</div>
		
	</body>
	<script src="../js/vue.js"></script>
	
	<script>
		
		const app=new Vue({
			el:"#app",
			// 存放私有数据地址
			data:{
				 index : 0,
				 imageArr:['https://preview.qiantucdn.com/agency/dp/dp_thumbs/2453601/83660102/staff_1024.jpg!w1024_new_small_1',
				     'https://preview.qiantucdn.com/auto_machine/20240517/cc20ec7a-eaff-44f4-9981-2eca1e4fde3c.png!qt_w320']
			},
			methods: {
				changeImage(){
					setInterval(()=> {
						this.index = this.index ===0?1:0;
					},1000);
				}
			},
			// vue组件生命周期，初始化
			created() {
				this.changeImage();
			}
		});
		
	</script>
</html>